<div ng-controller="withdrawMngCtrl">
    <h1 class="page-header">用户提现管理</h1>

    <div class="row">
        <div class="col-xs-6 col-sm-3">
            <div class="form-group">
                <label>用户名（手机号码）</label>
                <input class="form-control" ng-model="search.memberName"/>
            </div>
        </div>

        <div class="col-xs-6 col-sm-3">
            <div class="form-group">
                <label>银行卡号</label>
                <input class="form-control" ng-model="search.account"/>
            </div>
        </div>

        <div class="col-xs-6 col-sm-3">
            <div class="form-group">
                <label>开户姓名</label>
                <input class="form-control" ng-model="search.accountName"/>
            </div>
        </div>

        <div class="col-xs-2">
            <div class="form-group">
                <label>状态</label>
                <select class="form-control" ng-model="search.status">
                    <option value="" selected="selected">-------------默认-------------</option>
                    <option value="0">创建</option>
                    <option value="1">成功</option>
                    <option value="2">取消</option>
                </select>
            </div>
        </div>

        <div class="col-xs-6 col-sm-3">
            <div class="form-group input-group">
                <span class="input-group-btn">
                    <button class="btn btn-primary" type="button" ng-click="getPagedDataAsync()">
                        搜索
                    </button>
                </span>
            </div>
        </div>

    </div>
    <div class="row">
        <table class="table table-bordered top5">
            <thead>
            <tr>
                <th>用户名</th>
                <th>提现金额</th>
                <th>银行卡号</th>
                <th>开户银行</th>
                <th>开户姓名</th>
                <th>状态</th>
                <th>已取消记录的取消原因</th>
                <th>申请时间</th>
                <th>操作</th>
            </tr>
            </thead>

            <tbody>
            <tr ng-repeat="item in list">
                <td ng-bind="item.memberName"></td>
                <td ng-bind="item.amount"></td>
                <td ng-bind="item.account"></td>
                <td ng-bind="item.bank"></td>
                <td ng-bind="item.accountName"></td>
                <td ng-bind="item.statusName"></td>
                <td ng-bind="item.cancelReason"></td>
                <td ng-bind="item.addTime"></td>
                <td>
                    <a ng-show="item.status == 0" data-target="#transferModal" data-toggle="modal"
                       ng-click="getRecord(item);" class="btn btn-sm">转账</a>
                </td>
            </tr>
            </tbody>
        </table>

        <pagination boundary-links="true"
                    max-size="5"
                    items-per-page="search.pageSize"
                    total-items="count"
                    ng-model="pageIndex"
                    ng-change="pagedCallback()"></pagination>
    </div>

    <div class="modal fade" id="transferModal" tabindex="-1" role="dialog" aria-labelledby="transferModal"
         aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title">
                        转账
                    </h4>
                </div>
                <div class="modal-body">
                    <div>
                        <div>
                            <label>提现记录编号:</label>
                            <span ng-bind="withdraw.id"></span>
                        </div>

                        <div class="form-group">
                            <label>转账状态</label>
                            <select class="form-control" ng-model="withdraw.status">
                                <option value="1" selected="selected">转账成功</option>
                                <option value="2">取消转账</option>
                            </select>
                        </div>

                        <div ng-show="withdraw.status == 2">
                            <label>请填写取消转账的原因:</label>
                            <textarea  ng-model="withdraw.cancelReason" cols="80" rows="2"
                                      maxlength="200"/>
                        </div>
                    </div>

                </div>
                <p class="bg-danger"></p>
                <span class="success-message"></span>

                <div class="modal-footer">
                    <button type="button" class="btn btn-default"
                            data-dismiss="modal">取消
                    </button>
                    <input type="button" value="确定" class="btn btn-warning" ng-click="sendMessage();"/>

                </div>
            </div>
        </div>
    </div>
</div>